#!/usr/bin/env python3

import rospy
from DrEmpower_can.msg import write_property
# import DrEmpower as dr

def callback(data):
    import DrEmpower as dr
    dr.write_property(id_num=data.id_num, property=data.property, value=data.value)
    rospy.loginfo("write_property_node")


def listener():
    rospy.init_node("write_property", anonymous=True)
    rospy.Subscriber("write_property", write_property, callback)
    rospy.spin()


if __name__ == '__main__':
    listener()

